package com.abaaba.project2.controller.wxcontroller;

import com.abaaba.project2.bean.bo.WxTopicListBO;
import com.abaaba.project2.bean.vo.BaseRespVo;
import com.abaaba.project2.bean.vo.wx.WxTopicDetailVO;
import com.abaaba.project2.bean.vo.wx.WxTopicListVO;
import com.abaaba.project2.bean.vo.wx.WxTopicRelatedVO;
import com.abaaba.project2.mapper.AdTopicMapper;
import com.abaaba.project2.service.wx.WxTopicListService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.ArrayList;

/**
 * @Author Hedgehog
 * @Date 2021/6/8 23:43
 * @Version 1.0
 */
@RestController
@RequestMapping("/wx/topic")
public class WxTopicController {


    @Autowired
    WxTopicListService wxTopicListService;

    @RequestMapping("/list")
    public BaseRespVo wxTopicList(WxTopicListVO wxTopicListVO){

        WxTopicListBO wxTopicListBO = wxTopicListService.searchTopic(wxTopicListVO);

        return BaseRespVo.ok(wxTopicListBO);
    }

    @RequestMapping("/related")
    public BaseRespVo wxTopicRelated(Integer id){
        ArrayList<WxTopicRelatedVO> wxTopicRelatedVOS =wxTopicListService.relatedTopic(id);
        return BaseRespVo.ok(wxTopicRelatedVOS);
    }

    @RequestMapping("detail")
    public BaseRespVo wxTopicDetail(Integer id){

        WxTopicDetailVO wxTopicDetailVO = wxTopicListService.topicDetail(id);
        return BaseRespVo.ok(wxTopicDetailVO);
    }

}
